package com.glasses.primework;

import javax.faces.bean.ManagedBean;
import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.UploadedFile;

@ManagedBean
public class FileUploadBean {
    private UploadedFile file;
    
    public UploadedFile getFile() {
        System.out.println("FileUploadBean.getFile() = " + file);
        return file;
    }
    
    public void setFile(UploadedFile file) {
        System.out.println("FileUploadBean.setFile(...) = " + file);
        this.file = file;
    }
    
    public void handleFileUpload(FileUploadEvent event) {
        UploadedFile file = event.getFile();
        System.out.println("FileUploadBean.handleFileUpload(...) = " + event);
        //application code
    }
}
